package com.signway.module_signway_adapter_Api;

import android.content.Context;
import android.os.signwaymanager.SignwayManager;
import android.util.Log;

import com.signway.module_signway_adapter_Api.constant.ScreenResolutionBean;
import com.signway.open.api.IOpenDisplayApi;

/*
 * -----------------------------------------------------------------
 * Copyright (C) 2011-2019, by your Signway, All rights reserved.
 * -----------------------------------------------------------------
 *
 * ProjectName: droid5119
 *
 * Author: Administrator
 *
 * Email: pf.wang@Signway.cn
 *
 * Description:
 *
 * -----------------------------------------------------------------
 * 2019-5-29 : Create SignwayDisplayApi.java
 * -----------------------------------------------------------------
 */
public class SignwayDisplayApi implements IOpenDisplayApi {
    private static final String TAG = "SignwayDisplayApi";
    private static SignwayDisplayApi mSignwayDisplayApi;
    private static Context mContext;
    private SignwayManager signwayManager;

    public static synchronized SignwayDisplayApi getInstance(Context context) {
        mContext = context;
        if (mSignwayDisplayApi == null) {
            mSignwayDisplayApi = new SignwayDisplayApi(context);
        }
        return mSignwayDisplayApi;
    }

    public SignwayDisplayApi(Context context) {
        this.mContext = context;
        signwayManager = SignwayManager.getInstance(mContext);
    }

    public void setBackLightEnable(boolean isEnabled) {
    }

    public void setBrightness(int value) {
    }

    //对比度
    public void setContrast(int value) {

    }

    public void setColor(int value) {
    }

    public void setTint(int value) {
    }

    public void setSharpness(int value) {
    }

    @Override
    public String getLvdsResolution(int value) {
         String s = signwayManager.getScreenDisplay();;
        int lvdsResolution = 0;
        Log.d(TAG, "获得屏幕分辨率");

        Log.d(TAG, "得到屏幕分辨率结果：" + s);

        if(s != null && s.contains("@")){
            ScreenResolutionBean screenResolutionBean = new ScreenResolutionBean();
            lvdsResolution = screenResolutionBean.screenResolution(s);
        }

        signwayManager.getScreenDisplay();

        return lvdsResolution + "";
    }

    @Override
    public void setLvdsResolution(int value) {

    }


}
